home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 13 - 1997 (partial) / 13.04 Apr 97 / OpenDocExtentions / SelectPart / DataTransferExt / TextTransferExt.cpp < prev    next >
Encoding:
Text File  |  1996-06-19  |  5.0 KB  |  188 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.     File:        TextTransferExt.cpp
  3.  
  4.     Contains:    Text Transfer Extension class implementation
  5.  
  6.     Written by:    Andrey Dolgachev
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. ------------------------------------------------------------------------------*/
  10.  
  11. // -- Compiler/Preprocessor Notification --
  12.  
  13. #ifndef _COMPILERDEFS_
  14. #include "CompDefs.h"
  15. #endif
  16.  
  17. // -- OpenDoc Utilities --
  18.  
  19. #ifndef _EXCEPT_
  20. // Exceptions define several important macros (ie. CHECKENV)
  21. // which are used in the SOM method dispatch glue. If Except.h
  22. // is not included early enough, exceptions may not be thrown
  23. // correctly when returning from a SOM method with "ev" parameter set.
  24. #include <Except.h>
  25. #endif
  26.  
  27. // Notification that this is a SOM source file
  28. #define TextTransferExt_Class_Source
  29.  
  30. // define underscore field names (ie. _fSelf)
  31. #define VARIABLE_MACROS
  32.  
  33. // -- TextTransferExt Includes --
  34.  
  35. #ifndef SOM_TextTransferExt_xih
  36. #include "TextTransferExt.xih"
  37. #endif
  38.  
  39. // -- OpenDoc Includes --
  40.  
  41. #ifndef _ODTYPES_
  42. #include <ODTypes.h>
  43. #endif
  44.  
  45. #ifndef SOM_ODExtension_xh
  46. #include <Extensn.xh>
  47. #endif
  48.  
  49.  
  50. #pragma segment TextTransferExt
  51.  
  52.  
  53. //------------------------------------------------------------------------------
  54. // Method:            Release
  55. // Origin:            ODRefCountedObject
  56. //
  57. // Description:        The Release method decrements an object’s reference count
  58. //                    by 1, and tells the draft to release the object from 
  59. //                    memory if the ref count falls to 0. The parent class
  60. //                    must be called at the beginning of this method.
  61. //------------------------------------------------------------------------------
  62. SOM_Scope    void
  63. SOMLINK     TextTransferExt__Release
  64.             (
  65.                 TextTransferExt*    somSelf,
  66.                 Environment*        ev
  67.             )
  68. {
  69.     TextTransferExtMethodDebug("TextTransferExt","Release");
  70.  
  71.     TextTransferExt_parent_KSS_DataTransferExt_Release(somSelf, ev);
  72. }
  73.  
  74. //------------------------------------------------------------------------------
  75. // Method:        InitTextTransferExt
  76. // Origin:        TextTransferExt
  77. //------------------------------------------------------------------------------
  78. SOM_Scope    void
  79. SOMLINK        TextTransferExt__InitTextTransferExt
  80.             (
  81.                 TextTransferExt*    somSelf,
  82.                 Environment*        ev,
  83.                 ODPart*             owner
  84.             )
  85. {
  86.     TextTransferExtMethodDebug("TextTransferExt","InitTextTransferExt");
  87.  
  88.     somSelf->InitExtension(ev, owner);
  89. }
  90.  
  91. //------------------------------------------------------------------------------
  92. // Method:        GetSelection
  93. // Origin:        TextTransferExt
  94. //------------------------------------------------------------------------------
  95. SOM_Scope    ODBoolean
  96. SOMLINK        TextTransferExt__GetSelection
  97.             (
  98.                 TextTransferExt*    somSelf,
  99.                 Environment*        ev,
  100.                 ODULong*             start,
  101.                 ODULong*             end
  102.             )
  103. {
  104.     TextTransferExtMethodDebug("TextTransferExt", "GetSelection");
  105.     
  106.     ODBoolean    result = kODTrue;
  107.     
  108.     return result;
  109. }
  110.  
  111. //------------------------------------------------------------------------------
  112. // Method:        SetSelection
  113. // Origin:        TextTransferExt
  114. //------------------------------------------------------------------------------
  115. SOM_Scope     ODBoolean
  116. SOMLINK     TextTransferExt__SetSelection
  117.             (
  118.                 TextTransferExt*    somSelf,
  119.                 Environment*        ev,
  120.                 ODULong             start,
  121.                 ODULong             end
  122.             )
  123. {
  124.     TextTransferExtMethodDebug("TextTransferExt","SetSelection");
  125.  
  126.     ODBoolean result = kODTrue;
  127.  
  128.     return result;
  129. }
  130.  
  131. //------------------------------------------------------------------------------
  132. // Method:        AppendText
  133. // Origin:        TextTransferExt
  134. //------------------------------------------------------------------------------
  135. SOM_Scope    ODBoolean
  136. SOMLINK        TextTransferExt__AppendText
  137.             (
  138.                 TextTransferExt*            somSelf,
  139.                 Environment*                ev,
  140.                 ODPlatformType                type,
  141.                 ODByteArray*                 data
  142.             )
  143. {
  144.     TextTransferExtMethodDebug("TextTransferExt","AppendText");
  145.  
  146.     return kODFalse;
  147. }
  148.  
  149. //------------------------------------------------------------------------------
  150. // Method:        GetData
  151. // Origin:        DataTransferExt
  152. //
  153. // Description:    Call the parent class to retrieve the data from the part.
  154. //------------------------------------------------------------------------------
  155. SOM_Scope    ODBoolean
  156. SOMLINK        TextTransferExt__GetData
  157.             (
  158.                 TextTransferExt*        somSelf,
  159.                 Environment*            ev,
  160.                 ODPlatformType             type,
  161.                 ODByteArray*            data
  162.             )
  163. {
  164.     TextTransferExtMethodDebug("TextTransferExt","TextTransferExt__GetData");
  165.         
  166.     return ( TextTransferExt_parent_KSS_DataTransferExt_GetData(somSelf,ev,type,data) );
  167. }
  168.  
  169. //------------------------------------------------------------------------------
  170. // Method:        SetData
  171. // Origin:        DataTransferExt
  172. //
  173. // Description:    Call the parent class to set the part's data to that specified.
  174. //------------------------------------------------------------------------------
  175. SOM_Scope    ODBoolean
  176. SOMLINK        TextTransferExt__SetData
  177.             (
  178.                 TextTransferExt*        somSelf,
  179.                 Environment*            ev,
  180.                 ODPlatformType            type,
  181.                 ODByteArray*             data
  182.             )
  183. {
  184.     TextTransferExtMethodDebug("TextTransferExt","TextTransferExt__SetData");
  185.  
  186.     return ( TextTransferExt_parent_KSS_DataTransferExt_SetData(somSelf,ev,type,data) );
  187. }
  188.